<template>
	<view class="disagree">
		<uni-forms ref="dataForm" label-width="300rpx" :modelValue="dataForm" :rules="rules" label-position="top">
			<uni-forms-item label="不同意登记原因:" required name="yuanying">
				<uni-easyinput type="textarea" v-model="dataForm.yuanying" placeholder="请说明不同意登记原因..."></uni-easyinput>
			</uni-forms-item>
		</uni-forms>
		<view class="footer">
			<view class="button" @click="handleSubmit">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataForm: {
					yuanying: ''
				},
				rules: {
					yuanying: {
						rules: [{required: true, errorMessage: '请输入不同意登记原因！'}]
					},
				},
			}
		},
		methods: {
			handleSubmit() {
				this.$refs.dataForm.validate().then(res => {
					console.log('success', res);
					uni.switchTab({
						url: '/pages/index/index'
					})
				}).catch(err => {
					console.log('err', err);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.disagree{
		width: 94%;
		margin: 20rpx auto;
		.footer{
			height: 150rpx;
			.button{
				height: 80rpx;
				color: #fff;
				line-height: 80rpx;
				text-align: center;
				border-radius: 10rpx;
				background-image: linear-gradient(to right, #6AA9FF, #3C88FF, #156DFF);
			}
		}
	}
</style>